import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class stwk {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s1 = scanner.nextLine();
        String s2 = scanner.nextLine();
        List<Integer> size = CheckFirstLine(s1);
        List<Location> locations = CheckSecondLine(s2);
        if(size==null || locations==null){
            return;
        }
        scanner.close();
        render(size,locations);
    }

    public static  List<Integer> CheckFirstLine(String s){
        String[] strs = s.split(" ");
        //检验输入是否有效
        if(strs.length != 2){
            System.out.println("Incorrect command format.");
            return null;
        }
        List<Integer> line1 = new ArrayList<>();
        //检验字符串是否可以转换为数字
        try {
            for(int i=0;i< strs.length;i++){
                line1.add(Integer.parseInt(strs[i]));
            }
        }catch (Exception e){
            System.out.println("Invalid number format.");
            return null;
        }
        //检查数字范围
        for (int x : line1){
            if(x<1){
                System.out.println("Number out of range.");
                return null;
            }
        }
        return line1;
}

    public static  List<Location> CheckSecondLine(String s){
        String[] strs = s.split(";");
        List<String[]> strs2 = new ArrayList<>();  //[0,1] [0,2]
        List<Location> locations = new ArrayList<>();
        for(String str:strs){
            strs2.add(str.split(" "));
        }
        //检查
        for(String[] x:strs2){
            //检查输入是否合法
            if(x.length != 2){
                System.out.println("Incorrect command format.");
                return null;
            }
            //转换成整形数组
            try {
                locations.add(Location.getLocation(x));
            } catch (Exception e) {
                System.out.println("Invalid number format.");
                return null;
            }
        }
        return locations;
    }

    public static void render(List<Integer> size,List<Location> locations){
        int x = size.get(0)*2+1;
        int y = size.get(1)*2+1;
        int[][] map = new int[x][y];

        for(Location location:locations){
            int x1 = location.x1;
            int x2 = location.x2;
            int y1 = location.y1;
            int y2 = location.y2;
            if((x1!=x2 && y1!=y2) || (x1==x2 && Math.abs(y1-y2)>1) || (y1==y2 && Math.abs(x1-x2)>1)){
                System.out.println("Maze format error");
                return;
            }
            try {
                map[x1*2+1][y1*2+1] = 1;
                map[x2*2+1][y2*2+1] = 1;
                if(x1==x2){
                    map[x1*2+1][y1+y2+1] = 1;
                }else {
                    map[x1+x2+1][y1*2+1] = 1;
                }
            }catch (Exception e){
                System.out.println("Number out of range.");
                return;
            }
        }

        for (int j=0;j<x;j++){
            for (int k=0;k<y;k++){
                if(map[j][k]==0){
                    System.out.print("[W]");
                }else {
                    System.out.print("[R]");
                }
            }
            System.out.println();
        }
    }
}

class Location{
    int x1,x2;
    int y1,y2;

    public static Location getLocation (String[] str) throws Exception{
        Location location = new Location();
        location.x1 = Integer.parseInt(str[0].split(",")[0]);
        location.x2 = Integer.parseInt(str[1].split(",")[0]);
        location.y1 = Integer.parseInt(str[0].split(",")[1]);
        location.y2 = Integer.parseInt(str[1].split(",")[1]);
        return location;
    }
}
